<?php
/**
 * Created by PhpStorm.
 * User: bzyy
 * Date: 2015/7/4
 * Time: 16:37
 *
 *
 * 支付订单的简化处理
 *
 *
 */


require_once './init.php';

$sn = isset($_REQUEST['sn'])?$_REQUEST['sn']:'';

$mysql = init_mysql();
$sql = "select * from order where sn='{$sn}'";

$order = $mysql->getRow($sql);

if(empty($order))
{
    ajax_return(FLAG_ERROR,'订单编号无效');
}

if($order['is_pay'] == ORDER_PAYED)
{
    ajax_return(FLAG_ERROR,'此订单已经支付过了');
}

$sql = "update order set is_pay = '". ORDER_PAYED ."' where id='{$order['id']}'";
$mysql->query($sql);


ajax_return(FLAG_OK,'处理成功');








